home *** CD-ROM | disk | FTP | other *** search
/ com!online 2005 May / com_0505_1.iso / opensource / top10 / amc_install.exe / {app} / Scripts / Allocine (FR).ifs < prev    next >
Encoding:
Text File  |  2004-12-07  |  36.7 KB  |  1,178 lines

  1. // GETINFO SCRIPTING
  2. // AllocinΘ (FR) - Recherche de films - by ScorEpioN
  3.  
  4. (***************************************************
  5.  *  Movie importation script for:                  *
  6.  *      AllocinΘ France, http://www.allocine.fr    *
  7.  *                                                 *
  8.  *  Script AllocinΘ v20 du 06/12/2004 by ScorEpioN *
  9.  *                                                 *
  10.  *  Ancienne version :                             *
  11.  *  faite par Antoine Potten                       *
  12.  *  amΘliorations par Soltan                       *
  13.  *                                                 *
  14.  *  For use with Ant Movie Catalog 3.4.3           *
  15.  *  www.antp.be/software/moviecatalog              *
  16.  *                                                 *
  17.  *  This program is free software; you can         *
  18.  *  redistribute it and/or modify it under the     *
  19.  *  terms of the GNU General Public License as     *
  20.  *  published by the Free Software Foundation;     *
  21.  *  either version 2 of the License, or (at your   *
  22.  *  option) any later version.                     *
  23.  ***************************************************)
  24.  
  25. program Allocine_FR;
  26. const
  27.   GrandeImage = 1;
  28.     { 2: Prend la grande image
  29.       1: Prend l'affiche 0: Pas d'image }
  30.   PlusdActeurs = 1;
  31.     { 2: Prend la liste complΦte des acteurs
  32.       1: Prend les noms des acteurs de la page principale, 0: Pas d'acteurs }
  33.   PlusdeScene = 1;
  34.     { 2 : Prend la liste complΦte des scenes de tournage
  35.       1 : Prend les scenes de tournage de la page principale
  36.       0 : Ne prend pas les secrets de tournage }
  37.   Note = 2;
  38.     { 2 : Prend les notes dans le champs rating et dans le champs commentaire
  39.       1 : Prend les notes dans le champs rating avec une preference pour la note des spectateurs
  40.       0 : Ne prend pas les notes ni dans le champs commentaire ni dans le champs rating }
  41.   ConfirmTitre = 1;
  42.     { 1: Demande le titre avant de lancer le script
  43.       2: Ne demande pas le titre avant de lancer le script, 0 : Ne demande aucune comfirmation, 3 : Aucune Confirmation Premier Film si multiples resultats}
  44.   // Pour rΘcupΘrer ou non un champs
  45.   TitreOrignalConst = True;
  46.   TitreTraduitConst = True;
  47.   RealisateurConst = True;
  48.   PaysConst = True;
  49.   CategorieConst = True;
  50.   AnneeConst = True;
  51.   DureeConst = True;
  52.   AdresseWebConst = True;
  53.   SynopsisConst = True;
  54.   CommentWithSynopsis = False;
  55.   ImageAmazonFR = False;
  56.  
  57. var
  58.   MovieName, Adresse, AdressePlus, La_liste, LaGrandeImage, LaPremiereGrandeImage, Reponse, AdresseSuivant, AdressePrecedent, LePremierFilmAdresse, strTemp, aucunAmazon : string;
  59.   numPage, numPageG, numPageR, grandeTaille, premiereTaille, compteur, premiereExecution, numTemp : Integer;
  60.  
  61. //------------------------------------------------------------------------------
  62. // TROUVE UNE SOUS-CHAINE DE CARACTERE DANS UNE CHAINE
  63. //------------------------------------------------------------------------------
  64.  
  65. function FindLine(Pattern: string; List: TStringList; StartAt: Integer): Integer;
  66. var
  67.   i: Integer;
  68. begin
  69.   result := -1;
  70.   if StartAt < 0 then
  71.     StartAt := 0;
  72.   for i := StartAt to List.Count-1 do
  73.     if Pos(Pattern, List.GetString(i)) <> 0 then
  74.     begin
  75.       result := i;
  76.       Break;
  77.     end;
  78. end;
  79.  
  80. //------------------------------------------------------------------------------
  81. // ANALYSE DE LA PAGE DE RECHERCHES
  82. //------------------------------------------------------------------------------
  83.  
  84. procedure AnalyzePage(Address: string);
  85. var
  86.   Page: TStringList;
  87.   LineNr: Integer;
  88.   Line: string;
  89.   BeginPos, EndPos : Integer;
  90. begin
  91.   Page := TStringList.Create;
  92.   Page.Text := GetPage(Address);
  93.  
  94.   if pos('Pas de rΘsultats',Page.Text) <> 0 then
  95.   begin
  96.   if (ConfirmTitre = 1) or (ConfirmTitre = 2) then
  97.   begin
  98.     showmessage('Aucun film trouvΘ pour : '+MovieName);
  99.     exit;
  100.   end else
  101.   begin
  102.     SetField(fieldURL, 'Allo-cinΘ : aucun rΘsultat');
  103.     exit;
  104.   end;
  105.   end;
  106.  
  107.   if pos('Recherche :', Page.Text) = 0 then
  108.   begin
  109.     Adresse := Address;
  110.     AnalyzeMoviePage();
  111.   end else
  112.   begin
  113.     PickTreeClear;
  114.     LineNr := FindLine('<h3><b>Films <h4>', Page, 0);
  115.     if LineNr > -1 then
  116.     begin
  117.       EndPos := length(Page.Text);
  118.       Line := copy(Page.Text,1,EndPos);
  119.       BeginPos := Pos('<td colspan="2" valign="top">', Line);
  120.       Delete(Line, 1, BeginPos);
  121.       EndPos := length(Line);
  122.       Line := copy(Line,1,EndPos);
  123.       PickTreeAdd('Films trouvΘs pour ' + MovieName + ' :', '');
  124.       AddMoviesTitles(Line);
  125.       PickTreeAdd(' ', '');
  126.       PickTreeAdd('Verifier si vous avez la derniΦre version', 'version');
  127.     end;
  128.     if compteur = 1 then
  129.     begin
  130.       compteur := 0;
  131.       AnalyzeMoviePage();
  132.       exit;
  133.     end else if (ConfirmTitre = 1) or (ConfirmTitre = 2) then
  134.     begin
  135.       begin
  136.         if PickTreeExec(Address) then
  137.         begin
  138.           Adresse := Address;
  139.           if (Adresse = 'version') then
  140.           begin
  141.             verifVersion();
  142.           end else
  143.       if (Adresse = AdressePlus) then
  144.           begin
  145.             numPageR := numPageR+1;
  146.         AnalyzePage(AdressePlus);
  147.           end else
  148.           if (Adresse = AdressePrecedent) then
  149.           begin
  150.             numPageR := numPageR-1;
  151.         AnalyzePage(AdressePrecedent);
  152.           end else
  153.           if (Adresse = AdresseSuivant) then
  154.           begin
  155.             numPageR := numPageR+1;
  156.         AnalyzePage(AdresseSuivant);
  157.           end else
  158.           begin
  159.             AnalyzeMoviePage();
  160.           end;
  161.         end;
  162.       end;
  163.     end else
  164.     begin
  165.       if (ConfirmTitre = 3) then
  166.       begin
  167.         Adresse := LePremierFilmAdresse;
  168.         AnalyzeMoviePage();
  169.       end else
  170.       begin
  171.         SetField(fieldURL, 'Allo-cinΘ : rΘsultats multiples');
  172.         exit;
  173.       end;
  174.     end;
  175.   end;
  176.   Page.Free;
  177. end;
  178.  
  179. //------------------------------------------------------------------------------
  180. // VERIFIER LA VERSION DU SCRIPT
  181. //------------------------------------------------------------------------------
  182.  
  183. procedure verifVersion();
  184. var
  185.    Line, NewVersion, MaVersion, Telecharge : String;
  186.    BeginPos, EndPos : Integer;
  187. begin
  188.   MaVersion := '20';
  189.   Line := GetPage('http://forum.antp.be/phpbb2/viewtopic.php?t=1453');
  190.   BeginPos := pos('TELECHARGER LE SCRIPT ALLOCINE v', Line);
  191.   delete(Line,1, BeginPos+31);
  192.   EndPos := pos('du', Line);
  193.   NewVersion := copy(Line, 1, EndPos - 2);
  194.   PickTreeClear;
  195.   PickTreeAdd('Votre version est la '+MaVersion+', la derniΦre est la '+NewVersion+'.', '');
  196.   PickTreeAdd('Pour tΘlΘcharger la derniΦre version :', '');
  197.   PickTreeAdd('Cliquez ici', 'DL');
  198.   PickTreeAdd('Le script sera tΘlΘcharger dans le mΩme rΘpertoire que votre catalogue', '');
  199.   PickTreeAdd('Cliquez sur annuler pour quitter', '');
  200.   begin
  201.     if PickTreeExec(Telecharge)=true then
  202.       if (Telecharge = 'DL') then
  203.       begin
  204.         GetPicture('http://www.ifrance.com/ricoland/AlloCine.exe', True);
  205.       end else
  206.       begin
  207.         exit;
  208.       end;
  209.     end;
  210. end;
  211.  
  212. //------------------------------------------------------------------------------
  213. // FONCTION METS LE CHAMPS COMMENTAIRE A LA SUITE DU CHAMPS DESCRIPTION
  214. //------------------------------------------------------------------------------
  215. procedure moveComments();
  216. begin
  217.    SetField(fieldDescription,GetField(fieldDescription)+GetField(fieldComments));
  218.    SetField(fieldComments,'');
  219. end;
  220.  
  221. //------------------------------------------------------------------------------
  222. // ANALYSE DE LA PAGE DU FILM
  223. //------------------------------------------------------------------------------
  224.  
  225. procedure AnalyzeMoviePage();
  226. var
  227.   Line, Value, AdresseCasting, AdresseSecret, AdresseGalerie, aucun, Avertissement: string;
  228.   LineNr, IntValue: Integer;
  229.   BeginPos, EndPos, FinPos: Integer;
  230. begin
  231. //charge la page
  232.   Line := GetPage(Adresse);
  233.   Avertissement := '';
  234. // URL
  235.   if AdresseWebConst = True then
  236.   begin
  237.     if (ConfirmTitre = 3) then
  238.     begin
  239.       SetField(fieldURL, 'Allo-cinΘ : α verifier');
  240.     end else
  241.     begin
  242.       SetField(fieldURL, URLEncode(Adresse));
  243.     end;
  244.  
  245.   end;
  246. //translated title
  247.   if TitreTraduitConst = True then
  248.   begin
  249.   BeginPos := pos('<title>', Line);
  250.   delete(Line,1, BeginPos+6);
  251.   EndPos := pos('</title>', Line);
  252.   Value := copy(Line, 1, EndPos - 1);
  253.   Value := AnsiUpFirstLetter(Value);
  254.   Value := AnsiMixedCase(Value,' -');
  255.   SetField(fieldTranslatedTitle, Value);
  256.   end;
  257. // Picture
  258.   if (ImageAmazonFR = True) then
  259.   begin
  260.     imageAmazon(Value);
  261.     if (aucunAmazon <> 'aucune image') then
  262.     begin
  263.       if (pos('Toute la Galerie Photos', Line) > 0) then
  264.       begin
  265.         aucun := Adresse;
  266.     delete(aucun,1,pos('.fr', aucun)+3);
  267.           AdresseGalerie := 'http://www.allocine.fr/'+copy(aucun, 1, pos('/', aucun))+'galerie_gen_cfilm=';
  268.           delete(aucun,1,pos('=', aucun));
  269.           AdresseGalerie := AdresseGalerie +aucun;
  270.           grandeTaille := 0;
  271.           numPageG := 1;
  272.           galerieImage(AdresseGalerie);
  273.       end else
  274.       begin
  275.         BeginPos := pos('<td valign="top" style="padding:0 10 5 0">', Line);
  276.     delete(Line,1, BeginPos);
  277.       BeginPos := pos('width="100%"><img src=', Line);
  278.       delete(Line,1, BeginPos+22);
  279.     EndPos := pos('" border', Line);
  280.     Value := copy(Line, 1, EndPos - 1);
  281.     GetPicture(Value, False);
  282.       end;
  283.     end;
  284.   end;
  285.   if (GrandeImage = 1) then
  286.   begin
  287.   BeginPos := pos('<td valign="top" style="padding:0 10 5 0">', Line);
  288.   delete(Line,1, BeginPos);
  289.   BeginPos := pos('width="100%"><img src=', Line);
  290.   delete(Line,1, BeginPos+22);
  291.   EndPos := pos('" border', Line);
  292.   Value := copy(Line, 1, EndPos - 1);
  293.   GetPicture(Value, False);
  294.   end else
  295.   if (GrandeImage = 2) then
  296.   begin
  297.  // Adresse Galerie de photo
  298.     if pos('Toute la Galerie Photos', Line) > 0 then
  299.     begin
  300.       aucun := Adresse;
  301.       delete(aucun,1,pos('.fr', aucun)+3);
  302.       AdresseGalerie := 'http://www.allocine.fr/'+copy(aucun, 1, pos('/', aucun))+'galerie_gen_cfilm=';
  303.       delete(aucun,1,pos('=', aucun));
  304.       AdresseGalerie := AdresseGalerie +aucun;
  305.       grandeTaille := 0;
  306.       numPageG := 1;
  307.       galerieImage(AdresseGalerie);
  308.     end else
  309.     begin
  310.       BeginPos := pos('<td valign="top" style="padding:0 10 5 0">', Line);
  311.       delete(Line,1, BeginPos);
  312.       BeginPos := pos('width="100%"><img src=', Line);
  313.       delete(Line,1, BeginPos+22);
  314.       EndPos := pos('" border', Line);
  315.       Value := copy(Line, 1, EndPos - 1);
  316.       GetPicture(Value, False);
  317.     end;
  318.   end;
  319. // Director
  320.     if RealisateurConst = True then
  321.     begin
  322.     if pos('<h4>RΘalisΘ par ', Line) > 0 then
  323.     begin
  324.       Delete(Line, 1, pos('<h4>RΘalisΘ par ', Line) + 15);
  325.       EndPos := pos('</a></h4>', Line);
  326.       Value := copy(Line, 1, EndPos - 1);
  327.       HTMLRemoveTags(Value);
  328.       HTMLDecode(Value);
  329.       SetField(fieldDirector, Value);
  330.     end;
  331.     end;
  332. // Adresse casting complet
  333.     if pos('Voir tout le casting', Line) > 0 then
  334.     begin
  335.       Delete(Line, 1, pos('<h4><a href=', Line) + 12);
  336.       EndPos := pos('.html"', Line);
  337.       AdresseCasting := 'http://www.allocine.fr'+copy(Line, 1, EndPos + 4);
  338.     end;
  339. // Actors
  340.     if (PlusdActeurs = 1) then
  341.     begin
  342.     if pos('<h4>Avec ', Line) > 0 then
  343.     begin
  344.       Delete(Line, 1, pos('<h4>Avec ', Line) + 8);
  345.       EndPos := pos('</h4><br />', Line);
  346.       Value := copy(Line, 1, EndPos - 1);
  347.       HTMLRemoveTags(Value);
  348.       HTMLDecode(Value);
  349.       SetField(fieldActors, Trim(Value));
  350.     end;
  351.     end;
  352. //Country
  353.     if PaysConst = True then
  354.     begin
  355.     if pos('<h4>Film ', Line) > 0 then
  356.     begin
  357.       Delete(Line, 1, pos('<h4>Film ', Line) + 8);
  358.       EndPos := pos('</h4>', Line);
  359.       Value := copy(Line, 1, EndPos - 2);
  360.       Value := AnsiUpFirstLetter(Value);
  361.       Value := AnsiMixedCase(Value,' -');
  362.       Value := transformCountry(Value);
  363.       SetField(fieldCountry, Value);
  364.     end;
  365.     end;
  366. // Category
  367.     if CategorieConst = True then
  368.     begin
  369.     BeginPos := pos('<h4>Genre : ', Line);
  370.     if (BeginPos > 0) then
  371.     begin
  372.       Delete(Line, 1, pos('<h4>Genre : ', Line) + 11);
  373.       EndPos := pos('</h4>', Line);
  374.       Value := copy(Line, 1, EndPos - 1);
  375.       Value := AnsiUpFirstLetter(Value);
  376.       SetField(fieldCategory, Value);
  377.     end;
  378.     end;
  379. // Length
  380.     if DureeConst = True then
  381.     begin
  382.     if pos('DurΘe : ', Line) > 0 then
  383.     begin
  384.       Delete(Line, 1, pos('DurΘe : ', Line) + 7);
  385.       IntValue := StrToInt(copy(Line, 1, 1), 0) * 60;
  386.       if pos('min.', Line) > 0 then
  387.       begin
  388.         delete(Line,1,pos('h', Line) + 1);
  389.         Value := copy(Line, 1, pos('min.',Line)-1);
  390.         Value := StringReplace(Value, ' ', '');
  391.         IntValue := IntValue + StrToInt(Value, 0);
  392.       end;
  393.       SetField(fieldLength, IntToStr(IntValue));
  394.     end;
  395.     end;
  396. // Year
  397.     if AnneeConst = True then
  398.     begin
  399.     if pos('<h4>AnnΘe de production : ', Line) > 0 then
  400.     begin
  401.       Delete(Line, 1, pos('<h4>AnnΘe de production : ', Line)+24);
  402.       EndPos := pos('</h4>', Line);
  403.       Value := copy(Line, 1, EndPos -1);
  404.       SetField(fieldYear, Value);
  405.     end;
  406.     end;
  407. // Avertissement
  408.    BeginPos := pos('Interdit', Line);
  409.    if (BeginPos > 0) then
  410.    begin
  411.      Delete(Line, 1, BeginPos-1);
  412.      EndPos := pos('</h4>', Line);
  413.      Avertissement := copy(Line, 1, EndPos - 1)+#13#10#13#10;
  414.      SetField(fieldComments, Trim(Avertissement));
  415.    end;
  416. // Original Title
  417.   if TitreOrignalConst = True then
  418.   begin
  419.   BeginPos := pos('<h4>Titre original : ', Line);
  420.   if BeginPos <> 0 then
  421.   begin
  422.     delete(Line,1, BeginPos+20);
  423.     EndPos := pos('</h4>', Line);
  424.     Value := copy(Line, 1, EndPos - 1);
  425.     Value := AnsiUpFirstLetter(Value);
  426.     Value := AnsiMixedCase(Value,' -');
  427.     HTMLRemoveTags(Value);
  428.     SetField(fieldOriginalTitle, Value);
  429.   end else
  430.   begin
  431.     SetField(fieldOriginalTitle, GetField(fieldTranslatedTitle));
  432.   end;
  433.   end;
  434. // Productor + More actors
  435.     if (PlusdActeurs = 2) then
  436.     begin
  437.     castingComplet(AdresseCasting);
  438.     end;
  439. // Rating
  440.     if (pos('<h4>Critiques :', Line) > 0) and (Note <> 0)then
  441.     begin
  442.       Delete(Line, 1, pos('<h4>Critiques :', Line) + 14);
  443.       if pos('Presse', Line) > 0 then
  444.       begin
  445.       EndPos := pos('.gif', Line);
  446.       Delete(Line, 1, EndPos-2);
  447.       Value := copy(Line, 1, 1);
  448.       Delete(Line, 1, EndPos+3);
  449.       if Note = 2 then
  450.       begin
  451.         Avertissement := Avertissement + 'Note de la presse : ' + Value + '/4 ';
  452.       end;
  453.       if (Value = '0') then
  454.       begin
  455.         Value := '0';
  456.       end else
  457.       if (Value = '1') then
  458.       begin
  459.         Value := '2';
  460.       end else
  461.       if (Value = '2') then
  462.       begin
  463.         Value := '4';
  464.       end else
  465.       if (Value = '3') then
  466.       begin
  467.         Value := '6';
  468.       end else
  469.       if (Value = '4') then
  470.       begin
  471.         Value := '8';
  472.       end;
  473.       SetField(fieldRating,Value);
  474.       end;
  475.       if pos('Spectateurs', Line) > 0 then
  476.       begin
  477.       EndPos := pos('.gif', Line);
  478.       Delete(Line, 1, EndPos-2);
  479.       Value := copy(Line, 1, 1);
  480.       Delete(Line, 1, EndPos+3);
  481.       if Note = 2 then
  482.       begin
  483.         Avertissement := Avertissement + 'Note des spectateurs : ' + Value + '/4';
  484.       end;
  485.       if (Value = '0') then
  486.       begin
  487.         Value := '0';
  488.       end else
  489.       if (Value = '1') then
  490.       begin
  491.         Value := '2';
  492.       end else
  493.       if (Value = '2') then
  494.       begin
  495.         Value := '4';
  496.       end else
  497.       if (Value = '3') then
  498.       begin
  499.         Value := '6';
  500.       end else
  501.       if (Value = '4') then
  502.       begin
  503.         Value := '8';
  504.       end;
  505.       SetField(fieldRating,Value);
  506.       end;
  507.       if Note = 2 then
  508.       begin
  509.         Avertissement := Avertissement + #13#10#13#10;
  510.         SetField(fieldComments, Avertissement);
  511.       end;
  512.     end;
  513. // Description
  514.   if SynopsisConst = True then
  515.   begin
  516.   if pos('<h3><b>Synopsis', Line) > 0 then
  517.   begin
  518.    Delete(Line, 1, pos('<h3><b>Synopsis', Line));
  519.    Delete(Line, 1, pos('<h4>', Line) + 3);
  520.    EndPos := pos('</h4>', Line);
  521.    Value := copy(Line, 1, EndPos - 1);
  522.    HTMLRemoveTags(Value);
  523.    HTMLDecode(Value);
  524.    SetField(fieldDescription, Trim(Value));
  525.   end;
  526.   end;
  527. // Adresse tous les secrets de tournage
  528.     if pos('Tous les secrets de tournage', Line) > 0 then
  529.     begin
  530.       aucun := Adresse;
  531.       delete(aucun,1,pos('.fr', aucun)+3);
  532.       AdresseSecret := 'http://www.allocine.fr/'+copy(aucun, 1, pos('/', aucun))+'anecdote_gen_cfilm=';
  533.       delete(aucun,1,pos('=', aucun));
  534.       AdresseSecret := AdresseSecret +aucun;
  535.     end;
  536. // Commments
  537.   if (pos('<h3><b>Secrets de tournage', Line) > 0) and (PlusdeScene = 1) then
  538.   begin
  539.    Delete(Line, 1, pos('<h3><b>Secrets de tournage', Line));
  540.    Delete(Line, 1, pos('</table>', Line)+7);
  541.    Value := Avertissement+'Secrets de tournage :'+#13#10#13#10;
  542.    BeginPos := pos('<h4><b>', Line);
  543.    repeat
  544.      Delete(Line, 1, BeginPos+6);
  545.      EndPos := pos('</b></h4>', Line);
  546.      aucun := Trim(copy(Line, 1, EndPos - 1));
  547.      aucun := StringReplace(aucun, #13#10, '');
  548.      Value := Value + aucun +' :'+#13#10;
  549.      BeginPos := pos('<h4>', Line);
  550.      Delete(Line, 1, BeginPos-1);
  551.      FinPos := FinPos - BeginPos+1;
  552.      EndPos := pos('</h4>', Line);
  553.      aucun := Trim(copy(Line, 1, EndPos - 1));
  554.      aucun := StringReplace(aucun, #13#10, '');
  555.      Value := Value + aucun +#13#10#13#10;
  556.      Delete(Line, 1, EndPos-1);
  557.      FinPos := FinPos - EndPos+1;
  558.      BeginPos := pos('<h4><b>', Line);
  559.      delete(Line, 1, BeginPos-8);
  560.      FinPos := FinPos - BeginPos+8;
  561.      aucun := copy(Line, 1, 5);
  562.      BeginPos := pos('<h4><b>', Line);
  563.      FinPos := pos('</table>',Line);
  564.      if (BeginPos > FinPos) then
  565.      BeginPos := 0;
  566.    until ((BeginPos = 0) or (aucun = 'link1'));
  567.    HTMLRemoveTags(Value);
  568.    HTMLDecode(Value);
  569.    SetField(fieldComments, Trim(Value));
  570.   end else
  571.   if (pos('<h3><b>Secrets de tournage', Line) > 0) and (PlusdeScene = 2) then
  572.   begin
  573.    La_liste := Avertissement+'Secrets de tournage :'+#13#10#13#10;
  574.    numPage := 1;
  575.    secretComplet(AdresseSecret);
  576.   end;
  577.  
  578.   if (CommentWithSynopsis = True) then
  579.   begin
  580.     moveComments();
  581.   end;
  582.  
  583.   DisplayResults;
  584. end;
  585.  
  586. //------------------------------------------------------------------------------
  587. // ANALYSE DE LA PAGE CASTING
  588. //------------------------------------------------------------------------------
  589.  
  590. procedure castingComplet(pageCasting: string);
  591. var
  592.   Line, Role, Acteur, couple, liste, Producteur :string;
  593.   BeginPos, EndPos, OtherPos : Integer;
  594. begin
  595. //pour eviter les time-out
  596.   sleep(1500);
  597. //charge la page
  598.   Line := GetPage(pageCasting);
  599.   if (PlusdActeurs = 2) then
  600.   begin
  601.   if Pos('<b>Acteur(s)</b>', Line) > 0 then
  602.   begin
  603. //liste des acteurs
  604.   BeginPos := Pos('<b>Acteur(s)</b>', Line);
  605.   Delete(Line, 1, BeginPos);
  606.   BeginPos := Pos('<h5>', Line);
  607.   liste := '';
  608.   repeat
  609. // le role
  610.   delete(Line,1,BeginPos-1);
  611.   EndPos := Pos('</h5>', Line);
  612.   Role := copy(Line,1,EndPos);
  613.   HTMLRemoveTags(Role);
  614.   delete(Line,1,EndPos);
  615. // le nom de l'acteur
  616.   BeginPos := Pos('<h4><a href', Line);
  617.   delete(Line,1,BeginPos+3);
  618.   BeginPos := Pos('<h4>', Line);
  619.   delete(Line,1,BeginPos-1);
  620.   EndPos := Pos('</h4>', Line);
  621.   Acteur := copy(Line,1,EndPos);
  622.   HTMLRemoveTags(Acteur);
  623.   delete(Line,1,EndPos);
  624. // couple acteur (r⌠le)
  625.   if (Role <> '') then
  626.   begin
  627.     couple := Acteur +' ('+Role+'), ';
  628.   end else
  629.   begin
  630.     couple := Acteur +', ';
  631.   end;
  632. // ajout du couple dans la liste
  633.   if (Role <> 'ScΘnariste') then
  634.   begin
  635. // pour un nouvel ajout
  636.    BeginPos := Pos('<h5>', Line);
  637.    OtherPos := Pos('</table>',Line);
  638.    liste := liste + couple;
  639.    if (BeginPos > OtherPos) then
  640.    BeginPos := 0;
  641.   end else
  642.   begin
  643.    BeginPos := 0;
  644.   end;
  645.   until (BeginPos = 0);
  646.   EndPos := length(liste);
  647.   liste := copy(liste,1,EndPos-2)+'.';
  648.   SetField(fieldActors, liste);
  649.   end;
  650. // le producteur
  651.   if Pos('<h5>Producteur', Line) > 0 then
  652.   begin
  653.     BeginPos := Pos('<h5>Producteur', Line);
  654.     Delete(Line, 1, BeginPos);
  655.     BeginPos := Pos('<h4><a href', Line);
  656.     delete(Line,1,BeginPos+3);
  657.     BeginPos := Pos('<h4>', Line);
  658.     delete(Line,1,BeginPos+3);
  659.     EndPos := Pos('</h4>', Line);
  660.     Producteur := copy(Line,1,EndPos-1);
  661.     SetField(fieldProducer, Producteur);
  662.   end;
  663.   end;
  664. end;
  665.  
  666. //------------------------------------------------------------------------------
  667. // ANALYSE DE LA PAGE SECRETS DE TOURNAGE
  668. //------------------------------------------------------------------------------
  669.  
  670. procedure secretComplet(pageSecret: string);
  671. var
  672.   Line, LineSuivant, Titre, Texte, couple, pageSuivante :string;
  673.   BeginPos, EndPos : Integer;
  674. begin
  675. //pour eviter les time-out
  676.   sleep(1500);
  677. //charge la page
  678.   Line := GetPage(pageSecret);
  679.   LineSuivant := Line;
  680.   numPage := numPage + 1;
  681.   if Pos('Secrets de tournage</h2>', Line) > 0 then
  682.   begin
  683. //liste des secrets
  684.   BeginPos := Pos('Secrets de tournage</h2>', Line);
  685.   Delete(Line, 1, BeginPos);
  686.   BeginPos := Pos('<h4><b>', Line);
  687.   repeat
  688. // le titre
  689.      Delete(Line, 1, BeginPos+6);
  690.      EndPos := pos('</b></h4>', Line);
  691.      Titre := Trim(copy(Line, 1, EndPos - 1));
  692.      BeginPos := pos('<h4>', Line);
  693.      HTMLRemoveTags(Titre);
  694.      Titre := StringReplace(Titre, #13#10, '');
  695. // le texte
  696.      Delete(Line, 1, BeginPos-1);
  697.      EndPos := pos('</h4>', Line);
  698.      Texte := Trim(copy(Line, 1, EndPos - 1));
  699.      HTMLRemoveTags(Texte);
  700.      Texte := StringReplace(Texte, #13#10, '');
  701. // le couple titre : texte
  702.      couple := Titre+' :'+#13#10+Texte+#13#10#13#10;
  703.      Delete(Line, 1, EndPos-1);
  704.      if (Titre <> 'Toutes les offres spΘciales') then
  705.      begin
  706. // ajout du couple dans la liste
  707.        La_liste := La_liste + couple;
  708. // pour un nouvel ajout
  709.        //BeginPos := pos('<h4><b>', Line);
  710.        //delete(Line, 1, BeginPos-8);
  711.        BeginPos := pos('<h4><b>', Line);
  712.        EndPos := pos('</table>',Line);
  713.        if (BeginPos > EndPos) then
  714.        BeginPos := 0;
  715.      end else
  716.      begin
  717.        BeginPos := 0;
  718.      end;
  719.   until (BeginPos = 0);
  720.   SetField(fieldComments, La_liste);
  721. // si on a plusieurs pages
  722.   pageSuivante := pageSecret;
  723.   delete(pageSuivante,1,pos('.fr', pageSuivante)+2);
  724.   pageSuivante := copy(pageSuivante, 1, pos('.html', pageSuivante)-1);
  725.   if pos('page',pageSuivante) = 0 then
  726.   begin
  727.     pageSuivante := pageSuivante+'&page='+IntToStr(numPage)+'.html';
  728.   end else
  729.   begin
  730.     pageSuivante := copy(pageSuivante, 1, pos('&page=', pageSuivante)-1)+'&page='+IntToStr(numPage)+'.html';
  731.   end;
  732.   BeginPos := pos(pageSuivante,LineSuivant);
  733.   if BeginPos <> 0 then
  734.   begin
  735.     pageSuivante := 'http://www.allocine.fr'+pageSuivante;
  736.     secretComplet(pageSuivante);
  737.   end;
  738.   end;
  739. end;
  740.  
  741. //------------------------------------------------------------------------------
  742. // ANALYSE DE LA PAGE GALERIE
  743. //------------------------------------------------------------------------------
  744.  
  745. procedure galerieImage(pageGalerie: string);
  746. var
  747.   Line, Value, LineSuivant, pageSuivante :string;
  748.   BeginPos, EndPos, taille : Integer;
  749. begin
  750. //pour eviter les time-out
  751.   sleep(1500);
  752. //charge la page
  753.   Line := GetPage(pageGalerie);
  754.   LineSuivant := Line;
  755.   numPageG := numPageG + 1 ;
  756.   BeginPos := pos('<td  align="center" colspan="2">', Line);
  757.   delete(Line,1, BeginPos);
  758.   BeginPos := pos('<img src="', Line);
  759.   delete(Line,1, BeginPos+9);
  760.   EndPos := pos('" border', Line);
  761.   Value := copy(Line, 1, EndPos - 1);
  762.   delete(Line,1, EndPos);
  763.   BeginPos := pos('alt="', Line);
  764.   delete(Line,1, BeginPos+4);
  765.   EndPos := pos('Ko"', Line);
  766.   taille := StrToInt(Trim(copy(Line, 1, EndPos - 1)),0);
  767.   grandeTaille := taille;
  768.   LaGrandeImage := Value;
  769. (*  if numPageG = 2 then
  770.   begin
  771.     LaPremiereGrandeImage := Value;
  772.     premiereTaille := taille;
  773.   end;
  774. // si on a plusieurs pages
  775.   pageSuivante := pageGalerie;
  776.   delete(pageSuivante,1,pos('.fr', pageSuivante)+2);
  777.   pageSuivante := copy(pageSuivante, 1, pos('.html', pageSuivante)-1);
  778.   if pos('page',pageSuivante) = 0 then
  779.   begin
  780.     pageSuivante := pageSuivante+'&page='+IntToStr(numPageG)+'.html';
  781.   end else
  782.   begin
  783.     pageSuivante := copy(pageSuivante, 1, pos('&page=', pageSuivante)-1)+'&page='+IntToStr(numPageG)+'.html';
  784.   end;
  785.   BeginPos := pos(pageSuivante,LineSuivant);
  786.   if BeginPos <> 0 then
  787.   begin
  788.     pageSuivante := 'http://www.allocine.fr'+pageSuivante;
  789.     galerieImage(pageSuivante);
  790.   end;
  791.   if (premiereTaille > grandeTaille) then
  792.   begin
  793.     GetPicture(LaPremiereGrandeImage, False);
  794.   end else
  795.   begin *)
  796.     GetPicture(LaGrandeImage, False);
  797. (*  end; *)
  798. end;
  799.  
  800. //------------------------------------------------------------------------------
  801. // AJOUTE UN COUPLE FILM / ADRESSE A LA LISTE DE RESULTAT
  802. //------------------------------------------------------------------------------
  803.  
  804. procedure AddMoviesTitles(var Line: string);
  805. var
  806.   MovieTitle, MovieAddress, aucun: string;
  807.   StartPos, EndPos : Integer;
  808. begin
  809.  
  810. //compte les rΘsultats
  811.   compteur := 0;
  812.  
  813.   repeat
  814.     StartPos := pos('<h4><a href=', Line);
  815.     if StartPos > 0 then
  816.     begin
  817.       Delete(Line, 1, StartPos + 12);
  818.       EndPos := pos('.html"', Line);
  819.       MovieAddress := copy(Line, 1, EndPos+4);
  820.       StartPos := pos('>', Line)+1;
  821.       MovieTitle := copy(Line, StartPos, pos('</h4>', Line) - StartPos);
  822.       MovieTitle := StringReplace(MovieTitle, ' ', ' ');
  823.       HTMLRemoveTags(MovieTitle);
  824.       delete(Line,1,pos('</h4>',Line)-1);
  825.       aucun := copy(Line, 1, pos('</td>',Line)-1);
  826.       aucun := StringReplace(aucun, ' ', ' ');
  827.       aucun := StringReplace(aucun, #13#10, '');
  828.       aucun := StringReplace(aucun, '    ', '');
  829.       HTMLRemoveTags(aucun);
  830. // si on a des informations complΘmentaires
  831.       if (aucun <> '') then
  832.       begin
  833.         MovieTitle := MovieTitle +' '+aucun;
  834.       end;
  835.       PickTreeAdd(MovieTitle, 'http://www.allocine.fr' + MovieAddress);
  836.       adresse := 'http://www.allocine.fr' + MovieAddress;
  837.       if (compteur = 0) then
  838.       begin
  839.         LePremierFilmAdresse := adresse;
  840.       end;
  841.       compteur := compteur+1;
  842.     end;
  843.   until (StartPos < 1);
  844.  
  845. // si on a plus de rΘsultats
  846.   StartPos := pos('Plus de films',Line);
  847.   if StartPos <> 0 then
  848.   begin
  849.     AdressePlus := 'http://www.allocine.fr/recherche/?motcle='+UrlEncode(MovieName)+'&rub=1&page='+IntToStr(numPageR);
  850.     PickTreeAdd('Plus de rΘsultats',AdressePlus);
  851.   end;
  852.   numTemp := numPageR-1;
  853.   strTemp := IntToStr(numTemp);
  854.   if pos('<a href="/recherche/?motcle='+MovieName+'&rub=1&page='+strTemp,Line) <> 0 then
  855.   begin
  856.     AdressePrecedent := 'http://www.allocine.fr/recherche/?motcle='+UrlEncode(MovieName)+'&rub=1&page='+strTemp;
  857.     PickTreeAdd('Films prΘcΘdents',AdressePrecedent);
  858.   end;
  859.   numTemp := numPageR+1;
  860.   strTemp := IntToStr(numTemp);
  861.   if pos('<a href="/recherche/?motcle='+MovieName+'&rub=1&page='+strTemp,Line) <> 0 then
  862.   begin
  863.     AdresseSuivant := 'http://www.allocine.fr/recherche/?motcle='+UrlEncode(MovieName)+'&rub=1&page='+strTemp;
  864.     PickTreeAdd('Films suivants',AdresseSuivant);    
  865.   end;
  866.  
  867. end;
  868.  
  869. //------------------------------------------------------------------------------
  870. // RECUPERE GRANDE IMAGE AMAZON.FR
  871. // d'aprΦs le script de DaJoss (amazon.fr images uniquement)
  872. //------------------------------------------------------------------------------
  873.  
  874. procedure imageAmazon(title : String);
  875. var
  876.   Page: TStringList;
  877.   adresseRecherche, Line, lAddress : String;
  878.   LineNr: Integer;
  879. begin
  880.   adresseRecherche := 'http://www.amazon.fr/exec/obidos/search-handle-url/index=dvd-fr&field-title='+UrlEncode(title);
  881.   Page := TStringList.Create;
  882.   Page.Text := GetPage(adresseRecherche);
  883.   if pos('Sur ce DVD', Page.Text) > 0 then
  884.   begin
  885.     AnalyzeMoviePageAmazon(adresseRecherche);
  886.   end else
  887.   if pos('satisfaisante pour votre recherche sur', Page.Text) > 0 then
  888.   begin
  889.     //ShowMessage('Aucune image sur amazon pour : ' + MovieName);
  890.     aucunAmazon := 'aucune image' ;
  891.     exit;
  892.   end else
  893.   if pos('Les articles les plus recherchés correspondant à', Page.Text) > 0 then
  894.   begin
  895.     //PickTreeClear;
  896.     LineNr := 0;
  897.     LineNr := FindLine('résultats au total pour', Page, LineNr);
  898.     if LineNr > -1 then
  899.     begin
  900.       //PickTreeAdd('Films TrouvΘs sur amazon pour ' + MovieName + ' :', '');
  901.       AddMoviesTitlesAmazon(Page, LineNr);
  902.     end;
  903.     (*if PickTreeExec(lAddress) then
  904.       AnalyzeMoviePageAmazon(lAddress);*)
  905.   end else
  906.   begin
  907.     PickTreeClear;
  908.     LineNr := 0;
  909.     LineNr := FindLine('résultats au total pour', Page, LineNr);
  910.     if LineNr > -1 then
  911.     begin
  912.       //PickTreeAdd('Films TrouvΘs pour ' + MovieName + ' :', '');
  913.       AddMoviesTitlesAmazon(Page, LineNr);
  914.     end;
  915.     (*if PickTreeExec(lAddress) then
  916.       AnalyzeMoviePageAmazon(lAddress);*)
  917.   end;
  918. end;
  919.  
  920. procedure AnalyzeMoviePageAmazon(lAdresse: String);
  921. var
  922.   Line, Value : string;  
  923.   BeginPos, EndPos: Integer;
  924.  
  925. begin
  926.   Line := GetPage(lAdresse);
  927.   BeginPos := pos('<a href="http://images-eu.amazon.com/images/P/', Line);
  928.   Delete(Line, 1, BeginPos);
  929.   BeginPos := pos('src="', Line) + 4;
  930.   Delete(Line, 1, BeginPos);
  931.   EndPos := pos('"', Line);
  932.   Value := copy(Line, 1, EndPos - 1);
  933.   Value := StringReplace(Value, 'MZZZZZZZ', 'LZZZZZZZ'); // Change l'URL pour prendre la grande au lieu de la petite image
  934.   Sleep(500); // Attente 2X seconde : Evite les timeout sur le serveur
  935.   GetPicture(Value, False); // False = stocke l'image dans la base
  936. end;
  937.  
  938. procedure AddMoviesTitlesAmazon(Page: TStringList; var LineNr: Integer);
  939. var
  940.   Line: string;
  941.   MovieTitle, MovieAddress: string;
  942.   StartPos: Integer;
  943.   StartImg: Integer;
  944.   StartLst: Integer;
  945.   LastLine: Integer;
  946.  
  947. begin
  948.   //repeat
  949.     LineNr := LineNr + 1;
  950.     Line := Page.GetString(LineNr);
  951.     LastLine := Page.count;
  952.     StartPos := pos('<a href=/exec/obidos/ASIN/', Line);
  953.     StartImg := pos('<img src="http://images-eu.amazon.com/images/', Line);
  954.     StartLst := pos('</a>', Line);
  955.     if StartPos+StartImg+StartLst < StartPos+StartPos+StartPos-StartImg-StartLst then
  956.     begin
  957.       Startpos := Startpos + 9;
  958.       MovieAddress := copy(Line, StartPos, pos('qid', Line) - StartPos);
  959.       StartPos := pos('<b>', Line) + 3;
  960.       MovieTitle := copy(Line, StartPos, (StartPos + 150)- StartPos);
  961.       HTMLDecode(Movietitle);
  962.       //PickTreeAdd(MovieTitle, 'http://www.amazon.fr/' + MovieAddress);
  963.       AnalyzeMoviePageAmazon('http://www.amazon.fr/' + MovieAddress);
  964.     end;
  965.   //until (LineNr > Lastline);
  966. end;
  967.  
  968. //------------------------------------------------------------------------------
  969. // NETTOIE LE TITRE DU FICHIER POUR AVOIR LE TITRE DE FILM
  970. //------------------------------------------------------------------------------
  971.  
  972. function cleanTitle(title : String) : string;
  973. var
  974.   i,j, fin : Integer;
  975.   temp : String;
  976.  
  977. begin
  978.   title := AnsiUpperCase(title);
  979.  
  980.   if title <> '' then
  981.   begin
  982. // Nettoie les tags fichiers, merci Atmosfear pour les tags
  983.   i:=pos('.DVD',title);
  984.   if i <> 0 then
  985.   begin
  986.     title := copy(title,1,i-1);
  987.   end;
  988.   i:=pos('.DIVX',title);
  989.   if i <> 0 then
  990.   begin
  991.     title := copy(title,1,i-1);
  992.   end;
  993.   i:=pos('.FREN',title);
  994.   if i <> 0 then
  995.   begin
  996.     title := copy(title,1,i-1);
  997.   end;
  998.   i:=pos('.GERM',title);
  999.   if i <> 0 then
  1000.   begin
  1001.     title := copy(title,1,i-1);
  1002.   end;
  1003.   i:=pos('.INT',title);
  1004.   if i <> 0 then
  1005.   begin
  1006.     title := copy(title,1,i-1);
  1007.   end;
  1008.   i:=pos('.LIM',title);
  1009.   if i <> 0 then
  1010.   begin
  1011.     title := copy(title,1,i-1);
  1012.   end;
  1013.   i:=pos('.PROP',title);
  1014.   if i <> 0 then
  1015.   begin
  1016.     title := copy(title,1,i-1);
  1017.   end;
  1018.   i:=pos('.REPACK',title);
  1019.   if i <> 0 then
  1020.   begin
  1021.     title := copy(title,1,i-1);
  1022.   end;
  1023.   i:=pos('.SUBB',title);
  1024.   if i <> 0 then
  1025.   begin
  1026.     title := copy(title,1,i-1);
  1027.   end;
  1028.   i:=pos('.UNSUB',title);
  1029.   if i <> 0 then
  1030.   begin
  1031.     title := copy(title,1,i-1);
  1032.   end;
  1033.   i:=pos('.WS',title);
  1034.   if i <> 0 then
  1035.   begin
  1036.     title := copy(title,1,i-1);
  1037.   end;
  1038.   i:=pos('.XVID',title);
  1039.   if i <> 0 then
  1040.   begin
  1041.     title := copy(title,1,i-1);
  1042.   end;
  1043.   i:=pos('.AC3',title);
  1044.   if i <> 0 then
  1045.   begin
  1046.     title := copy(title,1,i-1);
  1047.   end;
  1048.   i:=pos('.UNRAT',title);
  1049.   if i <> 0 then
  1050.   begin
  1051.     title := copy(title,1,i-1);
  1052.   end;
  1053.  
  1054.    title := StringReplace(title, '.', ' ');
  1055.    title := StringReplace(title, ',', ' ');
  1056.    title := StringReplace(title, ':', '');
  1057.    title := StringReplace(title, '-', '');
  1058.    title := StringReplace(title, '  ', ' ');
  1059.  
  1060.    i := 0;
  1061. // Nettoie les tags de team
  1062.    if (pos('(',title) <> 0) then
  1063.    begin
  1064.      i := pos('(',title);
  1065.      temp := copy(title,0,i-1);
  1066.      j := pos(')',title);
  1067.      fin := Length(title);
  1068.      title := temp + copy(title,j+1,fin);
  1069.    end;
  1070.  
  1071.    if (pos('[',title) <> 0) then
  1072.    begin
  1073.      i := pos('[',title);
  1074.      temp := copy(title,1,i-1);
  1075.      j := pos(']',title);
  1076.      fin := Length(title);
  1077.      title := temp + copy(title,j+1,fin);
  1078.    end;
  1079.  
  1080.    title := AnsiLowerCase(title);
  1081.    title := AnsiUpFirstLetter(title);
  1082.    title := AnsiMixedCase(title,' -');
  1083.   end;
  1084.    result := title;
  1085. end;
  1086.  
  1087. //------------------------------------------------------------------------------
  1088. // TRANSFORME NATIONALITE EN PAYS
  1089. //------------------------------------------------------------------------------
  1090.  
  1091. function transformCountry(country : String) : string;
  1092. begin
  1093.   country := AnsiLowerCase(country);
  1094.   country := StringReplace(country, 'amΘricain', 'USA');
  1095.   country := StringReplace(country, 'japonais', 'Japon');
  1096.   country := StringReplace(country, 'franτais', 'France');
  1097.   country := StringReplace(country, 'tha∩landais', 'Tha∩lande');
  1098.   country := StringReplace(country, 'sud-corΘen', 'CorΘe');
  1099.   country := StringReplace(country, 'espagnol', 'Espagne');
  1100.   country := StringReplace(country, 'italien', 'Italie');
  1101.   country := StringReplace(country, 'britannique', 'Grande-Bretagne');
  1102.   country := StringReplace(country, 'hong-kongais', 'Hong-Kong');
  1103.   country := StringReplace(country, 'nΘo-zΘlandais', 'Nouvelle-ZΘlande');
  1104.   country := StringReplace(country, 'chinois', 'Chine');
  1105.   country := StringReplace(country, 'ta∩wanais', 'Ta∩wan');
  1106.   country := StringReplace(country, 'mexicain', 'Mexique');
  1107.   country := StringReplace(country, 'brΘsilien', 'BrΘsil');
  1108.   country := StringReplace(country, 'allemand', 'Allemagne');
  1109.   country := StringReplace(country, 'belge', 'Belgique');
  1110.   country := StringReplace(country, 'suΘdois', 'SuΦde');
  1111.   country := StringReplace(country, 'danois', 'Danemark');
  1112.   country := StringReplace(country, 'finlandais', 'Finlande');
  1113.   country := StringReplace(country, 'islandais', 'Islande');
  1114.   country := StringReplace(country, 'nΘerlandais', 'Pays-Bas');
  1115.   country := StringReplace(country, 'portugais', 'Portugal');
  1116.   country := StringReplace(country, 'canadien', 'Canada');
  1117.   country := StringReplace(country, 'australien', 'Australie');
  1118.   country := StringReplace(country, 'russe', 'Russie');
  1119.   country := StringReplace(country, 'tchΦque', 'RΘpublique TchΦque');
  1120.   country := StringReplace(country, 'chilien', 'Chili');
  1121.   country := StringReplace(country, 'hongrois', 'Hongrie');
  1122.   country := StringReplace(country, 'argentin', 'Argentine');
  1123.   country := StringReplace(country, 'roumain', 'Roumanie');
  1124.   country := StringReplace(country, '', '');
  1125.   result := country;
  1126. end;
  1127.  
  1128. //------------------------------------------------------------------------------
  1129. // PROGRAMME PRINCIPAL
  1130. //------------------------------------------------------------------------------
  1131.  
  1132. begin
  1133.   if CheckVersion(3,4,0) then
  1134.   begin
  1135.     numPageR := 1;
  1136.     MovieName := GetField(fieldTranslatedTitle);
  1137.     if MovieName = '' then
  1138.       MovieName := GetField(fieldOriginalTitle);
  1139.     MovieName := cleanTitle(MovieName);
  1140.     if (ConfirmTitre = 1) then
  1141.     begin
  1142.       if Input('AllocinΘ.fr by ScorEpioN', 'Entrez le titre du film :', MovieName) then
  1143.       begin
  1144.         if Pos('allocine.', MovieName) > 0 then
  1145.         begin
  1146.           adresse := MovieName;
  1147.           AnalyzeMoviePage();
  1148.         end else
  1149.         begin
  1150.           AnalyzePage('http://www.allocine.fr/recherche/?motcle='+UrlEncode(MovieName)+'&rub=1');
  1151.         end;
  1152.       end;
  1153.     end else
  1154.     begin
  1155.       if (premiereExecution = 0) then
  1156.       begin
  1157.           premiereExecution := -1;
  1158.       PickTreeClear;
  1159.           PickTreeAdd('Vous allez executer le script AllocinΘ sans confirmation', '');
  1160.           PickTreeAdd('Cliquez ici pour continuer', 'Oui');
  1161.       PickTreeAdd('Cliquez sur annuler pour ne pas executer le script', '');
  1162.       begin
  1163.         if PickTreeExec(Reponse)=true then
  1164.               if (Reponse = 'Oui') then
  1165.               begin
  1166.               AnalyzePage('http://www.allocine.fr/recherche/?motcle='+UrlEncode(MovieName)+'&rub=1');
  1167.         end;
  1168.       end;
  1169.       end else
  1170.       begin
  1171.           AnalyzePage('http://www.allocine.fr/recherche/?motcle='+UrlEncode(MovieName)+'&rub=1');
  1172.       end;
  1173.     end;
  1174.   end else
  1175.     ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.4.0)');
  1176. end.
  1177.  
  1178.